<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>商品详情</title>
		<script type="text/javascript" src="js/jquery.min.js"></script>
		<meta name="renderer" content="webkit">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
		<link rel="stylesheet" href="css/layui.css" media="all">
		<!-- 注意：如果你直接复制所有代码到本地，上述css路径需要改成你本地的 -->
		<style>
			li{
				list-style-type:disc;
				font-size: 16px;
				font-family: "zhengwen";
			}
			p{
				font-size: 16px;
				font-family: "zhengwen";
			}
		</style>
			
	</head>
	<body>
		<div class="layui-carousel" id="test1" lay-filter="test1">
			<div carousel-item="" id="imgsone">

			</div>
		</div>
		
		<div class="layui-collapse" lay-filter="test" style="width: 840px;">
			<div class="layui-colla-item" style="width: 840px;">
				<div class="layui-colla-title" style="font-size: 18px;font-weight: 600;">特色</div>
				<div class="layui-colla-content">
					<ul>
						<li>房间面积为38-44平方米/473平方英尺。</li>
						<li>可饱览开阔的北京国贸CBD景色。</li>
						<li>可享受豪华阁贵宾廊专属服务及礼遇。</li>
						<li>柔软舒适的睡床及羽绒被。</li>
						<li>设有独立淋浴间/浴缸。</li>
					</ul>
				</div>
			</div>
			<div class="layui-colla-item" style="width: 840px;">
				<h2 class="layui-colla-title"style="font-size: 18px;font-weight: 600;">设施</h2>
				<div class="layui-colla-content">
					<ul id="shes">

					</ul>
				</div>
			</div>
			<div class="layui-colla-item" style="width: 840px;">
				<h2 class="layui-colla-title"style="font-size: 18px;font-weight: 600;">关于新日暮里</h2>
				<div class="layui-colla-content">
					<p>入住酒店的6岁以下儿童在一位付费成人宾客陪同下，可于全日餐厅享用*自助餐点，无需额外付费；至多2名儿童用餐。超出2名的6岁以下儿童及6岁以上12岁以下儿童用餐，享受自助餐50%优惠。*享用自助餐点需视供应情况而定。</p>
				</div>
			</div>
			<div class="layui-colla-item" style="width: 840px;">
				<h2 class="layui-colla-title"style="font-size: 18px;font-weight: 600;">酒店入住宾客适用于儿童餐饮计划</h2>
				<div class="layui-colla-content">
					<p>入住酒店的6岁以下儿童在一位付费成人宾客陪同下，可于全日餐厅享用*自助餐点，无需额外付费；至多2名儿童用餐。超出2名的6岁以下儿童及6岁以上12岁以下儿童用餐，享受自助餐50%优惠。*享用自助餐点需视供应情况而定。</p>
				</div>
			</div>
		</div>


		<script src="layui.js" charset="utf-8"></script>
		<!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->

		<script>
		 //获取url参数
		 var rtid;
		 function getParam() {
		var url = location.search; //获取url中"?"符后的字串
		if (url.indexOf("?") != -1) {
		var str = url.substr(1);
		strs = str.split("&");
		 rtid= decodeURIComponent(strs[0].replace("rtid=", ""));
		 return rtid;
		}
	 }
		
		$(function(){
			getParam();
			  $.ajax({
				   url:"/imgs",
				   dataType:"json",
				   data:{rtid:rtid},
				   type:"post",
				   success:function(data){
					   var html;
					   var spring;
					   var food;
					   var window;
					   for(var i=0;i<data.myimgs.length;i++){
						   html="<div><img src=img/"+data.myimgs[i].imgpath+" style='width:860px;height: 460px;'></div>"
						   $(html).appendTo($("#imgsone"));
					   }
					   window="<li>复古窗户："+data.rwindow+"</li>";
						food="<li>精致早餐："+data.rfood+"</li>";
						spring="<li>营养高汤："+data.rspring+"</li>";
						$(window).appendTo($("#shes"));
						$(food).appendTo($("#shes"));
						$(spring).appendTo($("#shes"));
				   }
			   })  
		})
			layui.use(['carousel', 'form'], function() {
				var carousel = layui.carousel,
					form = layui.form;

				//常规轮播
				carousel.render({
					elem: '#test1',
					arrow: 'always',
					width: '840px',//设置容器宽度
					height:'460px'
				});
			});
			//页码
			layui.use(['laypage', 'layer'], function() {
				var laypage = layui.laypage,
					layer = layui.layer;
				laypage.render({
					elem: 'demo1',
					count: 70 //数据总数
						,
					jump: function(obj) {
						console.log(obj)
					}
				});
				laypage.render({
					elem: 'demo2',
					count: 70 //数据总数
						,
					jump: function(obj) {
						console.log(obj)
					}
				});
			});

			layui.use('element', function() {
				var element = layui.element; //导航的hover效果、二级菜单等功能，需要依赖element模块

				//监听导航点击
				element.on('nav(demo)', function(elem) {
					//console.log(elem)
					layer.msg(elem.text());
				});
				
			});


			layui.use('form', function() {
				var form = layui.form;

				//监听提交
				form.on('submit(formDemo)', function(data) {
					layer.msg(JSON.stringify(data.field));
					return false;
				});
			});
		</script>

	</body>
</html>
